import { LocalizeTask } from "../LocalizeOption.js";

const jsonTask: LocalizeTask = {
    "roots": ['assets/ui/subitem', 'assets/ui/system', 'assets/resources'], 
    "option": {
        "includes": {
            "exts": ['.lh']
        }
    },
    "group": "UI"
};
const srcTask: LocalizeTask = {
    "roots": ['src'], 
    "option": {
        "excludes": {
            "dirs": ['ui'],
            "files": ['maints.js']
        }, 
        "includes": {
            "exts": ['.ts', '.js']
        }, 
        "skipPatterns": ["^\\s*console\\.log", "^\\s*uts\\.log", "^\\s*console\\.assert\\(", "^\\s*uts\\.assert\\("]
    },
    "group": "代码"
};
const tsTask: LocalizeTask = {
    "roots": ['TsScripts'], 
    "option": {
        "excludes": {
            "dirs": ['types'], 
            "files": ['TestView.ts', 'Macros.ts', 'ErrorId.ts']
        }, 
        "includes": {
            "exts": ['.ts']
        }, 
        "skipPatterns": ["^\\s*console\\.log", "^\\s*uts\\.log", "^\\s*console\\.assert\\(", "^\\s*uts\\.assert\\("]
    },
    "group": "代码"
};
const clientCfgTask = {
    "roots": ['assets/data'], 
    "option": {
        "includes": {
            "exts": ['.json']
        }, 
        "excludes" : {
            "files": ['PlayerNameM.json']
        }
    },
    "group": "表格"
};
const svrScriptTask = {
    "roots": ['$workspace/serverscript'], 
    "option": {
        "includes": {
            "exts": ['.cxx', '.atm']
        }, 
        "skipPatterns": ["^\\s*ATM_DebugSystemMessage\\("]
    },
    "group": "脚本"
};
const svrCfgTask = {
    "roots": ['$workspace/servercfg'], 
    "option": {
        "includes": {
            "exts": ['.xml']
        }, 
        "excludes" : {
            "files": ['WorldName.xml', 'RobotNameConfig.xml', 'NewbieTutorial.config.xml']
        }
    },
    "group": "表格"
};

const searchTasks: LocalizeTask[] = [jsonTask, srcTask, tsTask, clientCfgTask, svrScriptTask, svrCfgTask];
const replaceTasks: LocalizeTask[] = [jsonTask, srcTask,  tsTask, clientCfgTask];
const replacer = {'$workspace': '..'};
const Laya3Tasks = {searchTasks, replaceTasks, replacer};
export default Laya3Tasks;